package w83b.w83bOperacionesPaso.w83bPreavisos;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.DynaActionForm;

import w83b.w83bBeans.W83bPreavisosBean;
import w83b.w83bUtilidadesComunes.W83bClsConstantes;
import es.ejie.frmk.presentacion.operacion.paso.Q70ActionPasoOP;
import es.ejie.frmk.presentacion.sesiondatos.Q70ContextoEJIE;

public class W83bAtrasNuevoEdicionAction extends Q70ActionPasoOP{

	
	protected void processOP(Q70ContextoEJIE contexto, ActionErrors errores, ActionMapping mapping,
			ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {
		
		contexto.set("migas","inicio.preavisos.busqPreavisos");
		contexto.set("strTitleKey","comun.preavisos.busqueda");
		contexto.set("modoPantalla",W83bClsConstantes.MODO_BUSQUEDA_CONBUSQ_INICIAL);
		contexto.set("w83bSubOpFlag","preavisos");	
		
		contexto.set("w83bPreavisosBean",contexto.get("w83bPreavisosTempBean"));
		contexto.set("w83bprovincia",((W83bPreavisosBean)contexto.get("w83bPreavisosTempBean")).getCentroTrabajo().getCodTerritorio());
		contexto.set("w83bmunicipio",((W83bPreavisosBean)contexto.get("w83bPreavisosTempBean")).getCentroTrabajo().getCodMunicipio());
		contexto.set("pestanyaPreaviso","1");
		DynaActionForm formu = (DynaActionForm)form;
		formu.set("w83bPreavisosBean", contexto.get("w83bPreavisosTempBean"));
		formu.set("w83bprovincia",((W83bPreavisosBean)contexto.get("w83bPreavisosTempBean")).getCentroTrabajo().getCodTerritorio());
		formu.set("w83bmunicipio",((W83bPreavisosBean)contexto.get("w83bPreavisosTempBean")).getCentroTrabajo().getCodMunicipio());
		request.setAttribute("w83bFormBusqPreavisos", formu);
		
	}

	protected ActionForward processForward(Q70ContextoEJIE contexto, ActionErrors errors, ActionMapping mapping, 
			ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {

		return mapping.findForward("ok");
	}

}